<template>
    <vue-json-editor v-model="json" @json-change="onJsonChange"
        :mode="'code'" lang="zh"></vue-json-editor>
</template>

<script>
import vueJsonEditor from './components/vue-json-editor'
export default {
  components: { vueJsonEditor },
  data: () => ({
    json: {
      msg: 'demo of jsoneditor'
    }
  }),

  methods: {
    submit (_e) {
      alert(JSON.stringify(this.model))
    },
    reset () {
      this.$refs.JsonEditor.reset()
    },
    onJsonChange (v) {
      console.log('value:', v)
    },
    onJsonSave (e) { console.log('value:', e) },
    onError (e) { console.log('value:', e) }
  }

}
</script>
